#ifndef GLIST_H_
#define GLIST_H_

/*
Copyright (C) 2011 Salil Bhagurkar

This file is part of illusion

illusion is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

illusion is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with illusion.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <kernel/types.h>

struct generic_list {
	void *data;
	struct generic_list *next, *prev;
};

struct generic_list *generic_list_find(struct generic_list *head, void *data);
struct generic_list *generic_list_add(struct generic_list **head, struct generic_list **tail, void *data);
bool generic_list_remove(struct generic_list **head, struct generic_list **tail, void *data);
void generic_list_remove_node(struct generic_list **head, struct generic_list **tail, struct generic_list *node);

#endif /* GLIST_H_ */
